#include <iostream>

using namespace std;

struct A
{
	virtual void operator() () const { cout << "A" << endl; }
};

struct B : public A
{
	virtual void operator() () const { cout << "B" << endl; }
};

int main()
{
	A* pA = new B;
	A& a = *pA;
	a();
}